# _*_ coding utf-8 _*_
# george
# time: 2025/1/11上午11:35
# name: app.py
# comment:
import os

from flask import Flask


def create_app():
    # 指定template位置:template_folder
    app = Flask(__name__, template_folder="../template", static_url_path="/", static_folder="../resource")
    # 注册蓝图
    init_blueprint(app)

    app.config["SECRET_KEY"] = os.urandom(24)  # 生成随机数种子,用于seesionId

    return app


def init_blueprint(app):
    from controller.user import user
    app.register_blueprint(user)
    from controller.home import index
    app.register_blueprint(index)
    from controller.project import project
    app.register_blueprint(project)
    from controller.team import team
    app.register_blueprint(team)
    from controller.file import file
    app.register_blueprint(file)
